function weights = performQLearn(weights, lambda, gamma, eta, tau, ...
                        maxMoves, avgErrorCount, pieces)

           
[weights, error, score, gameLength, xAxis] = ...
            qLearn(weights, lambda, gamma, eta, tau, maxMoves, avgErrorCount, pieces);
                                                
figure, plot(xAxis, error);
figure, plot(score);
figure, plot(gameLength);

save weights weights;
